#include <stdio.h>
#include <pthread.h>
#include <sys/types.h>
#include <sys/syscall.h>
#include <unistd.h>
#include <stdlib.h>

void * pthread_1(void *num)
{
    printf("before system,in pthread_1, the tid=%lu, pid=%ld\n",pthread_self(),syscall(SYS_gettid));
    system("ls");//调用system函数
    printf("after system,in pthread_1, the tid=%lu, pid=%ld\n",pthread_self(),syscall(SYS_gettid));
}
int main(int argc, char *argv[])
{
    pthread_t thread_1;
    pthread_create(&thread_1,NULL,pthread_1,NULL);
    pthread_join(thread_1,NULL);
    return 0;
}

